var app = getApp();

Page({
  data: {
    isLoading: false,
    isNoData: true,
    assessList: []
  },
  onLoad: function () {
    var that = this;
    wx.showLoading({
      title: '加载中',
    });
    this.getAssList();
  },
  // 获取问卷列表
  getAssList: function () {
    var that = this;
    wx.request({
      url: app.globalData.apiBaseUrl + '/wechat/selectSysLogInfoList',
      header: {
        'content-type': 'application/json; charset=utf-8',
        'FilterToken_MT': wx.getStorageSync("token")
      },
      method: 'GET',
      data: {
        telephone: wx.getStorageSync("telephone")
      },
      dataType: 'json',
      success: function (msg) {
        msg = msg.data;
        if (msg.code == 200) {
          that.setData({
            assessList: msg.data,
            isLoading: true
          })
          if (msg.data.length > 0) {
            that.setData({
              isNoData: true
            })
          } else {
            that.setData({
              isNoData: false
            })
          }
          wx.hideLoading();
        } else {
          wx.hideLoading();
          wx.showToast({
            title: msg.msg,
            icon: 'none',
            duration: 3000
          })
        }
      }
    })
  }
})